home *** CD-ROM | disk | FTP | other *** search
- # Install-ALine
- #
- # The A-line installer
- #
- # To install A-line, just run this script.
- # If you want the Development folder somewhere other than {Boot},
- # then create it where you like and make {Boot}Development be an alias to it.
-
- # Initial state: A-line folder is unpacked.
- # Objectives:
- # * Alias the UserStartup script to {MPW}Startup Items.
- # * Create {Boot}Development (if it doesn't already exist).
- # * Alias our Scripts folder to {Boot}Development.
- # * Create {Boot}Development:Menu.
- #
- # Because MakeAlias uses Perl, we either need to have the Perl tool installed,
- # use SendAE with the scriptable Finder, ask the user to make the alias,
- # or just bag the whole thing and use an application as the installer.
- # For now, we require Perl.
-
- # Save our full pathname.
- Set MYPATHNAME "{Command}"
-
- Set TAG "Install-ALine"
-
- # Disable exceptions. We especially need this for 'Which'.
- Set Exit 0
-
- # Make sure we have Perl before continuing.
- If "`Which Perl`" == ""
- Echo "{TAG}: Sorry, A-line could not be installed because the Perl tool is not available."
- Echo "{TAG}: Please install the Perl MPW tool and try again."
- Exit 1
- End
-
- # Locate A-line's Scripts folder, which is the one containing this script.
- # Our ad hoc Perl script is a simplified Basename.
- set SCRIPTS "`Perl -e '$_ = shift; s/[^:]+$//; print;' "{MYPATHNAME}"`"
-
- If {Status}
- Echo "{TAG}: There was some problem running Perl. ({Status})"
- Exit 1
- End
-
- If !"{SCRIPTS}"
- Echo "{TAG}: There was some problem running Perl, though it didn't bother to mention that."
- Exit 1
- End
-
- # Put ourselves in the command search path.
- Set Commands "{Commands},{SCRIPTS}"
-
- # Make an alias to the UserStartup file in MPW's Startup Items folder.
-
- Set USAL "UserStartup•A-line"
- UpdateAlias "{SCRIPTS}{USAL}" "{MPW}Startup Items:" "{USAL}"
-
- # Create the Development folder.
- Set DEV Development
- If !"`Exists -d "{Boot}{DEV}"`"
- If "`Exists -f "{Boot}{DEV}"`"
- Echo "{TAG}: You have a file named '{DEV}' at the root of '{Boot}'."
- Echo "{TAG}: Please put it somewhere else."
- Exit 1
- Else If "`Exists -n "{Boot}{DEV}"`"
- Echo "{TAG}: You have a broken alias named '{DEV}' at the root of '{Boot}'."
- Echo "{TAG}: Please remove it."
- Exit 1
- Else
- Echo "{TAG}: Making new folder '{Boot}{DEV}'."
- NewFolder "{Boot}{DEV}"
- If {Status}
- Echo "{TAG}: There was some problem running NewFolder. ({Status})"
- Exit 1
- End
- End
- Else
- Echo "{TAG}: Using existing folder '{Boot}{DEV}'."
- End
-
- # Make an alias to the Scripts folder in the Development folder.
-
- Set USAL "UserStartup•A-line"
- UpdateAlias "{SCRIPTS}" "{Boot}{DEV}:" "Scripts"
-
- # Create the Menu folder.
- If !"`Exists -d "{Boot}{DEV}:Menu"`"
- Echo "{TAG}: Making new folder '{Boot}{DEV}:Menu'."
- NewFolder "{Boot}{DEV}:Menu"
- If {Status}
- Echo "{TAG}: There was some problem running NewFolder. ({Status})"
- Exit 1
- End
- End
-
- Echo "{TAG}: Installation complete."
-